package com.maozzi.web.controller.view;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 首页 controller
 *
 * @author maozi
 */
@Slf4j
@Controller
@RequestMapping("view")
public class IndexViewController {

    /**
     * 首页
     */
    @GetMapping("/")
    public String index() {
        log.info("index 首页");
        return "index";
    }

    /**
     * 登录页面
     */
    @GetMapping("/login")
    public String login(ModelAndView model) {
        model.addObject("title", "登录");
        return "login";
    }

    /**
     * 注册页面
     */
    @GetMapping("/signup")
    public String signup(ModelAndView model) {
        model.addObject("title", "注册");
        return "signup";
    }

}
